package zuoye_50;
//题目：求0—7所能组成的奇数个数。
public class Zuoye_043 {
	public static void main(String[] args) {
		int sum = 0;
        int count = 0;
        for (int i = 1; i <= 8; i++) {
            if (i == 1) count += 4;
            if (i == 2) count *= 7;
            if (i >= 3) count *= 8;
            sum += count;
            System.out.println("只有" + i + "位数时的奇数个数：" + count);
        }
        System.out.println("0-7所组成的奇数个数是：" + sum);
	}
}
